cmake_minimum_required(VERSION 3.12)
project(opengl)
set(CMAKE_CXX_STANDARD 11)

set(INC_DIR include) #包含目录 include
aux_source_directory(src DIR_SRC) #源文件目录(当前目录设置到变量DIR_SRC)
aux_source_directory(src/demo1 DIR_SRC_DEMO1) #源文件目录

include_directories(${INC_DIR}) # 添加包含目录
add_executable(opengl ${DIR_SRC} ${DIR_SRC_DEMO1})

#需要链接的库
target_link_libraries(opengl dl glfw3 GL pthread X11 Xrandr Xxf86vm Xinerama Xcursor Xi m)